home *** CD-ROM | disk | FTP | other *** search
- /*
- File: ST_.h
-
- Contains: xxx put contents here xxx
-
- Owned by: Nick Pilch
-
- Copyright: © 1996 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <1> 6/21/96 NP first checked in
-
- To Do:
- */
-
- #ifndef DECLARE_ST_
-
- #define DECLARE_ST_(CLASSNAME, TYPE, DTOR, SAFEVAL) \
- \
- class CLASSNAME { \
- private: \
- TYPE the##TYPE; \
- void operator = (const TYPE &a##TYPE); \
- public: \
- CLASSNAME (const TYPE &a##TYPE) {the##TYPE = a##TYPE;} \
- ~CLASSNAME () {if (the##TYPE != SAFEVAL) DTOR (the##TYPE);} \
- operator TYPE& (void) {return the##TYPE;} \
- void Forget (void) {the##TYPE = SAFEVAL;} \
- };
-
- #define DECLARE_STP_(CLASSNAME, TYPE, DTOR, SAFEVAL) \
- \
- class CLASSNAME { \
- private: \
- TYPE the##TYPE; \
- void operator = (const TYPE &a##TYPE); \
- public: \
- CLASSNAME (const TYPE &a##TYPE) {the##TYPE = a##TYPE;} \
- ~CLASSNAME () {if (the##TYPE != SAFEVAL) DTOR (&the##TYPE);} \
- operator TYPE& (void) {return the##TYPE;} \
- void Forget (void) {the##TYPE = SAFEVAL;} \
- };
-
- #endif
-